package routes

import (
	"GoWeb_Advanced/10_web_app2/logger"
	"GoWeb_Advanced/10_web_app2/settings"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Setup() *gin.Engine {
	r := gin.New()
	r.Use(logger.GinLogger(), logger.GinRecovery(true))

	r.GET("/", func(context *gin.Context) {
		context.String(http.StatusOK, "OK")
	})

	r.GET("/version", func(context *gin.Context) {
		context.JSON(http.StatusOK, settings.Conf)
	})

	r.Run()

	return r
}
